/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.isen.web.webservicetemp.controller;

import fr.isen.web.webservicetemp.Entity.Temperature;
import fr.isen.web.webservicetemp.Service.TemperatureService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 *
 * @author Maistre Louis
 */
@Controller
public class JSONController {
    
    @Autowired
    TemperatureService temperatureService;

    public void setTemperatureService(TemperatureService temperatureService) {
        this.temperatureService = temperatureService;
    }
    
    
    @RequestMapping(value="/Json/temp", method = RequestMethod.GET)
	public @ResponseBody List<Temperature> getAllTempInJSON() {
        
        return temperatureService.getAllTemperature();
	
    }
}
